package cn.duli.myvideo.service.Impl;

import cn.duli.myvideo.mapper.CollectTvMapper;
import cn.duli.myvideo.pojo.CollectTv;
import cn.duli.myvideo.service.CollectTvService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CollectTvServiceImpl implements CollectTvService {

    @Resource
    private CollectTvMapper collectTvMapper;

    @Override
    public Page<CollectTv> findAll() {
        return collectTvMapper.findAll();
    }

    @Override
    public Integer findCountByTvId(Integer tvId) {
        return collectTvMapper.findCountByTvId(tvId);
    }

    @Override
    public List<CollectTv> findByUserId(Integer uId) {
        return collectTvMapper.findByUserId(uId);
    }

    @Override
    public List<CollectTv> findByTvId(Integer tvId) {
        return collectTvMapper.findByTvId(tvId);
    }

    @Override
    public void save(CollectTv collectTv) {
        collectTvMapper.save(collectTv);
    }

    @Override
    public void deleteById(Integer ctvId) {
        collectTvMapper.deleteById(ctvId);
    }
}
